﻿using System;
using System.Collections.Generic;
using QuailServices.QuailDataServiceReference;

namespace Quail
{
    /// <summary>
    /// The task implementation
    /// </summary>
    public interface ITaskImplementor : IDisposable
    {
        /// <summary>
        /// Adds a message to the log
        /// </summary>
        /// <param name="state">The entry state</param>
        /// <param name="message">The message</param>
        /// <param name="url">The Url</param>
        void AddImpl(LogStatus state, string message, string url);

        /// <summary>
        /// Logs a screenshot
        /// </summary>
        /// <param name="state">The screenshot state</param>
        /// <param name="filename">Location of the screenshot image</param>
        /// <param name="message">The mesage for the screenshot</param>
        void ScreenshotImpl(LogStatus state, string filename, string message);

        /// <summary>
        /// Impementation of the rollback
        /// </summary>
        void RollbackImpl();

        /// <summary>
        /// Implementation of the add attribute
        /// </summary>
        /// <param name="attribute">name of attribute</param>
        /// <param name="message">message for attribute</param>
        void AddAttributeImpl(string attribute, string message);

        /// <summary>
        /// implementation of Finish
        /// </summary>
        /// <param name="state">the state of the task</param>
        void FinishImpl(LogStatus state);

        /// <summary>
        /// Begins a new task
        /// </summary>
        /// <param name="testsession">The test session</param>
        /// <param name="taskname">the name of the task</param>
        /// <returns>A new Task object</returns>
        ITaskImplementor BeginNewTaskImpl(TestSession testsession, string taskname);

        /// <summary>
        /// Stops the log
        /// </summary>
        /// <param name="logger">The test logger</param>
        void StopImpl(TestLogger logger);

        /// <summary>
        /// Flushes the log
        /// </summary>
        void FlushImpl();

        /// <summary>
        /// Stores the network traffic.
        /// </summary>
        /// <param name="url">the url or name for the traffic</param>
        /// <param name="url">the url or name for the traffic remote control host</param>
        /// <param name="urlCounter">the number of times this url has been hit in this test run</param>
        /// <param name="msUntilReady">The number of ms until the ready event is triggered</param>
        /// <param name="traffic">The traffic.</param>
        void StoreNetworkTrafficImpl(string url, string remoteControlUrl, int urlCounter, int msUntilReady, List<NetworkTrafficData> traffic);

        ///<summary>
        /// Stores the TestMonitor information.
        ///</summary>
        ///<param name="state">the state of the task</param>
        ///<param name="scenario">the monitoring scenario performed</param>
        ///<param name="message">message</param>
        ///<param name="testrunid">message</param>
        void StoreMonitorImpl(LogStatus state, Enum scenario, string message);
    }
}
